package com.stn.zjx.givingtreasure.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class MainFragmentAdapter extends FragmentPagerAdapter {
    public Context context;
    public List<Fragment> fragments;
    public MainFragmentAdapter(Context context, FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.context=context;
        this.fragments=fragments;
    }
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

}
